package basic.thread;

public class SubThread extends Thread{
	
	public SubThread(String name){
		super(name);
	}

	public void run(){
		System.out.println("name:"+this.getName());
		for(int i=0;i<100;i++){
			System.out.println(System.nanoTime());
		}
	}
	
	public static void main(String[] args) {
		SubThread[] test = new SubThread[4];
		for(int i=0;i<test.length;i++){
			test[i] = new SubThread(i+"");
		}
		for(int i=0;i<test.length;i++){
			test[i].start();
		}
		Thread main = Thread.currentThread();
		System.out.println(main.getName()+" thread is stoped."+main.toString());
	}
}
